//
//  LLQuickCacheMacrocDefine.h
//  LLFoundation
//
//  Created by my_liu on 2016/11/14.
//  Copyright © 2016年 . All rights reserved.
//

/**
 *  文件描述
 *
 *  这个工具类宏定义封装了对
 *  NSUserDefault,NSCache,NSFileManager
 *  NSKeyedArchieve,NSDocumentDirectory,NSCacheDirectory的便捷操作
 */

#import "LLQuickCacheUitil.h"

/* 写宏定义的时候，前面变量参数的名字，多参数的时候不能方法名和后面调用方法的参数名字一样 */

/**
 *  检查一个valueObj,keyObj对象是否有一个是空的
 */
#define LLCheckKeyValueHasNull(keyObj,valueObj) [LLQuickCacheUitil checkValue:valueObj key:keyObj]

/**
 *  检查一个对象是否为空
 */
#define LLCheckObjectNull(object) [LLQuickCacheUitil isNullObject:object]

/**
 *  NSUserDefault 保存键值对 keyObj,valueObj
 */
#define LLUDFCache(keyObj,valueObj) [LLQuickCacheUitil userDefaultCache:valueObj key:keyObj]

/**
 *  NSUserDefault 删除键keyObj对应的值
 */
#define LLUDFRemove(keyObj) [LLQuickCacheUitil userDefaultRemove:keyObj]

/**
 *  NSUserDefault 获取键keyObj对应的值
 */
#define LLUDFGetValue(keyObj) [LLQuickCacheUitil userDefaultGetValue:keyObj]

/**
 *  NSUserDefault 判断键keyObject对应的值是否为空
 */
#define LLUDFEmptyValue(keyObj) [LLQuickCacheUitil userDefaultEmptyValue:keyObj]

/**
 *  NSCache 存储键值对 keyObj,valueObj
 */
#define LLNSCacheSet(keyObj,valueObj) [LLQuickCacheUitil systemMemoryCacheSet:valueObj key:keyObj]

/**
 *  NSCache 删除键keyObj对应的值
 */
#define LLNSCacheRemove(keyObj) [LLQuickCacheUitil systemMemoryCacheRemove:keyObj]

/**
 *  NSCache 获取键keyObj对应的值
 */
#define LLNSCacheGetValue(keyObj) [LLQuickCacheUitil systemMemoryCacheGetValue:keyObj]

/**
 *  NSCache 判断键keyObject对应的值是否为空
 */
#define LLNSCacheEmptyValue(keyObj) [LLQuickCacheUitil systemMemoryCacheEmptyValue:keyObj]

/**
 *  获取系统默认文件管理
 */
#define LLFileManager [LLQuickCacheUitil fileManager]

/**
 *  指定路径pathObj是否存在文件
 */
#define LLFileIsExist(pathObj) [LLQuickCacheUitil fileExist:pathObj]

/**
 *  指定路径pathObj是否存在目录
 */
#define LLFileDirectoryIsExist(pathObj) [LLQuickCacheUitil directoryExist:pathObj]

/**
 *  读取某个路径的二进制数据，返回 NSData
 */
#define LLFileRead(pathObj) [LLQuickCacheUitil readFromFile:pathObj]

/**
 *  将二进制数据写入文件 dataObj:NSData pathObj:NSString
 */
#define LLFileWrite(dataObj,pathObj) [LLQuickCacheUitil writeFileData:dataObj toPath:pathObj]

/**
 *  在指定路径创建目录，返回BOOL结果
 */
#define LLFileDirectoryCreate(pathObj) [LLQuickCacheUitil createDirectory:pathObj]

/**
 *  删除指定路径文件
 */
#define LLFileDeleteFile(path) [LLQuickCacheUitil deleteFileAtPath:path]

/**
 *  删除指定目录
 */
#define LLFileDeleteDirectory(path) [LLQuickCacheUitil deleteDirectoryAtPath:path]

/**
 *  从fromFilePath复制文件到toFilePath,shouldRemove标示是否删除复制源文件
 */
#define LLFileCopyFileIsRemove(fromFilePath,toFilePath,shouldRemove) [LLQuickCacheUitil copyFileFromPath:fromFilePath toPath:toFilePath isRemoveOld:shouldRemove]

/**
 *  将某个对象归档到指定路径
 */
#define LLArchieveObject(object,filePath) [LLQuickCacheUitil archieveObject:object toFilePath:filePath]

/**
 *  从指定路径读取被归档过的对象
 */
#define LLUnArchieveObject(fromFilePath) [LLQuickCacheUitil unarchieveFromPath:fromFilePath]

/**
 *  获取NSDocumentDirectory目录
 */
#define LLAppDocumentDirectory [LLQuickCacheUitil documentDirectory]

/**
 *  获取NSCacheDirectory目录
 */
#define LLAppCacheDirectory [LLQuickCacheUitil cacheDirectory]

/**
 *  返回文件名为fileName在NSDocumentDirectory中的路径
 */
#define LLAppDoucmentPath(fileName) [LLQuickCacheUitil documentDirectoryPath:fileName]

/**
 *  返回文件名为fileName在NSCacheDirectory中的路径
 */
#define LLAppCachePath(fileName) [LLQuickCacheUitil cacheDirectoryPath:fileName]

/**
 *  将object对象用fileName名字保存到NSDocumentDirectory目录下
 */
#define LLAppDocumentSave(object,fileName) [LLQuickCacheUitil documentDirectorySave:object withFileName:fileName]

/**
 *  将object对象用fileName名字保存到NSCacheDirectory目录下
 */
#define LLAppCacheSave(object,fileName) [LLQuickCacheUitil cacheDirectorySave:object withFileName:fileName]

/**
 *  删除NSDocumentDirectory目录下名为fileName的文件
 */
#define LLAppDocumentDelete(fileName)  [LLQuickCacheUitil documentDirectoryDelete:fileName]

/**
 *  删除NSCacheDirectory目录下名为fileName的文件
 */
#define LLAppCacheDelete(fileName) [LLQuickCacheUitil cacheDirectoryDelete:fileName]
